package com.sporadic.desk.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sporadic.desk.dao.TableAreaDao;
import com.sporadic.desk.pojo.TableArea;
import com.sporadic.desk.service.TableAreaService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: sporadic
 * @description:
 * @author: LHD   QQ:1727865856
 * @create: 2019-10-23 14:49
 **/
@Service
public class TableAreaServiceImpl extends ServiceImpl<TableAreaDao, TableArea> implements TableAreaService {

    /**
     * 根据商家id查询 商家门店餐桌区域
     *
     * @param mid 商家id
     * @return
     */
    @Override
    public List<TableArea> queryAll(Integer mid) {
        List<TableArea> list = null;
        try {
            QueryWrapper queryWrapper = new QueryWrapper();
            queryWrapper.eq("m_id", mid);
            list = super.list(queryWrapper);
        } catch (Exception e) {
            throw new RuntimeException("对不起查询失败！");
        }
        return list;
    }
}
